#include "dbutils.h"
#include "QSqlDatabase"
#include"iostream"
#include <QCoreApplication>
using namespace std;
DBUtils::DBUtils()
{

    QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
    db.setUserName("root");
    db.setPassword("123456");
    db.setPort(3306);
    db.setHostName("127.0.0.1");
    db.setDatabaseName("TDS_tables");
    if(db.open()){
        cout<<"db open success"<<endl;
    }else{
        cout<<"db open error"<<endl;
    }

}

DBUtils::~DBUtils(){
    cout<<"delete db instance"<<endl;
}
